#include "Intersection.h"


Intersection::Intersection(){
	theRay = NULL;
	hasIntersect = false;
}

Intersection::Intersection(Ray *_ray){
	theRay = _ray;
	hasIntersect = false;
	theShape = NULL;
	curDist = 1e30f;
	surfaceNormal = vec3();
}


Intersection::~Intersection(){
}

float Intersection::dist(){
	return curDist;
}
void Intersection::dist(float _d){
	curDist = _d;
	hasIntersect = true;
}

vec3 Intersection::getPos(){
	//returns the position of the intersection in world space
	return theRay->pointAtDepth(curDist);
}
